package com.hehua.FactoryMethodTwo;

/**
 * @author hehua
 * @Date 2022-04-17
 * 数据库具体工厂
 */
public class DatabaseLoggerFactory implements LoggerFactory {
    @Override
    public Logger createLogger() {
        DatabaseLogger databaseLogger = new DatabaseLogger();
        return databaseLogger;
    }

    @Override
    public Logger createLogger(String args) {
        //使用参数args作为字符串连接数据库,代码省略
        DatabaseLogger databaseLogger = new DatabaseLogger();
        DatabaseLogger connect = databaseLogger.getConnect(args);
        return connect;
    }

    @Override
    public Logger createLogger(Object obj) {
        //使用封装在参数obj中的连接字符串来连接数据库,代码省略
        return new DatabaseLogger();
    }
}
